package com.demo.spring.aop底层演示.demo2;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Before;

//Test类在org.springframework.aop.framework里，为了可以调用受保护的方法
public class Aspect {
	
	@Before("execution(* foo())")
	public void before1() {
		System.out.println("before1");
	}
	
	@Before("execution(* foo())")
	public void before2() {
		System.out.println("before2");
	}
	
	public void after() {
		System.out.println("after");
	}
	
	@AfterReturning("execution(* foo())")
	public void afterReturning() {
		System.out.println("afterReturning");
	}
	
	@AfterThrowing("execution(* foo())")
	public void afterThrowing() {
		System.out.println("afterThrowing");
	}
	
	@Around("execution(* foo())")
	public Object around(ProceedingJoinPoint pjp) {
		System.out.println("around");
		return null;
	}

}
